package cn.iocoder.yudao.module.handguard.enums;

import cn.hutool.core.util.ArrayUtil;
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 通用状态枚举
 *
 * @author 芋道源码
 */
@Getter
@AllArgsConstructor
public enum OrderFlowEnum implements IntArrayValuable {
    ONE(1, "完善资料"),
    TWO(2, "下放额度"),
    THREE(3, "申请贷款"),
    FOUR(4, "业务员处理"),
    FIVE(5, "权证处理"),
    SIX(6, "资料审核"),
    SEVEN(7, "银行面签填贷款申请表"),
    EIGHT(8, "考察抵押物和经营场所"),
    NINE(9, "银行出批复"),
    TEN(10, "银行面签抵押合同和借款合同"),
    ELEVEN(11, "办理抵押"),
    TWELVE(12, "办公证"),
    THIRTEEN(13, "放款");

    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(OrderFlowEnum::getStatus).toArray();

    /**
     * 状态名
     */
    private final Integer status;

    /**
     * 状态值
     */
    private final String statusName;


    @Override
    public int[] array() {
        return ARRAYS;
    }



    public static OrderFlowEnum valueOf(Integer value) {
        return ArrayUtil.firstMatch(status -> status.getStatus().equals(value), OrderFlowEnum.values());
    }

}
